Animating a node for the duration of its lifetime
When you animate a node for the duration of its lifetime, the animation starts when the node is attached to the scene graph, and runs for as long as the node is attached to the scene graph.
To animate nodes for the duration of their lifetime:
- In the Project select or create the node you want to animate.
For example, create an Image node or a Sphere node.
- Create an animation with a Timeline Sequence and a Timeline Entry. See Creating keyframe animations.
- In the Library select the Timeline Entry, and in the Properties enable the Infinite property in the Repeat Count property.
- In the Project select the node you are animating, in the Triggers click , and add the On Attached trigger.
- In the Triggers click the drop-down menu, and select the Play Animation action.
The Message Editor opens.
-
In the Message Editor set:
- Target Item to <Relative> and use
.
for the path to animate the node that has the trigger.
- Animation to the Timeline Sequence that contains the Timeline Entry with the Animation Clip that animates your node.
Kanzi animates the node when it attaches it to the scene graph and runs the animation for as long as the node is attached to the scene graph.
See also
Tutorial: Create keyframe animations
Creating keyframe animations
Changing the interpolation mode between keyframes
Creating animations and timelines using the Kanzi Engine API
Editing animation clips
Editing timeline sequences
Animations best practices
Animations
Open topic with navigation